package com.yuanfeng.job.job;


import com.yuanfeng.job.dto.ForSettleShopInfoDTO;
import com.yuanfeng.job.service.ForSettleShopService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


/**
 * @author lxt
 *经销订单商家结算单
 */
public class SettleDealerAccountsJob implements BaseJob {

	@Autowired
	SettleAccountsServices settleAccountsServices;

	@Autowired
	ForSettleShopService forSettleShopService;

    @Override
    public void execute(JobExecutionContext context)
        throws JobExecutionException {  
    	System.out.println("开始执行SettleAccountsJob");
    	List<ForSettleShopInfoDTO> settleShopInfos = forSettleShopService.getForSettleCommonShopInfo();
		for(ForSettleShopInfoDTO settleShopInfo : settleShopInfos){
			//单个进行结算
			settleAccountsServices.settleDealerAccounts(settleShopInfo);
		}
    	
          
    }  
}  